const db=require('../db/index')
exports.saveMoeny=(req,res)=>{
    const saveMoenyObj=req.body
    saveMoenyObj.userId=req.user.id
    db.query('insert into savedetail set ?',saveMoenyObj,(err,result)=>{
        if(err){
            return req.resSend(401,err)
        }
        if(result.affectedRows!==1){
            return req.resSend(404,'存钱失败！')
        }
        req.resSend(200,'存钱成功!')
    })
}